﻿using System.Collections.Generic;

namespace Sherwood.Configuration
{
    ///<summary>
    /// Provides a way of instantiating types by a group name
    ///</summary>
    public interface IPluginProvider
    {
        ///<summary>
        /// Will instantiate an instance of each configured type and return them all together.
        ///</summary>
        ///<param name="name">The group name of the plugins (typically filename or section)</param>
        ///<param name="returnEmptyIfNotFound">Allow method to return no instances if there is no configuration available</param>
        ///<typeparam name="T">The type of plugins to return (instances are casted to this type)</typeparam>
        ///<returns>Created instances</returns>
        IEnumerable<T> InstantiatePlugins<T>(string name, bool returnEmptyIfNotFound);
    }
}